<?php


namespace app\manage\controller;

use app\manage\model\Token;
use think\Db;
use think\Validate;
class Statis
{
    public function __construct()
    {
        $this->token=new Token();
        $this->statis=new \app\manage\model\Statis();
    }

    /**
     * 首页数据统计
     */
    public function index(){

        $timestamp = time();
        $start_time = strtotime(date( 'Y-m-1 00:00:00', $timestamp ));
        $mdays = date( 't', $timestamp );
        $end_time = strtotime(date( 'Y-m-' . $mdays . ' 23:59:59', $timestamp ));
        $two_start_time = strtotime(date('Y-m-01 00:00:00',strtotime('-1 month')));
        $two_end_time = strtotime(date("Y-m-d 23:59:59", strtotime(-date('d').'day')));

        $three_start_time = date('Y-m-01 00:00:00',strtotime('-2 month'));
        $three_end_time = strtotime(date("Y-m-d 23:59:59", strtotime("$three_start_time +1 month -1 day")));
        $three_start_time=strtotime($three_start_time);

        $four_start_time = date('Y-m-01 00:00:00',strtotime('-3 month'));
        $four_end_time =strtotime( date("Y-m-d 23:59:59", strtotime("$four_start_time +1 month -1 day")));
        $four_start_time=strtotime($four_start_time);

        $five_start_time = date('Y-m-01 00:00:00',strtotime('-4 month'));
        $five_end_time = strtotime(date("Y-m-d 23:59:59", strtotime("$five_start_time +1 month -1 day")));
        $five_start_time=strtotime($five_start_time);

        $six_start_time = date('Y-m-01 00:00:00',strtotime('-5 month'));
        $six_end_time = strtotime(date("Y-m-d 23:59:59", strtotime("$six_start_time +1 month -1 day")));
        $six_start_time=strtotime($six_start_time);

        $seven_start_time = date('Y-m-01 00:00:00',strtotime('-6 month'));
        $seven_end_time = strtotime(date("Y-m-d 23:59:59", strtotime("$seven_start_time +1 month -1 day")));
        $seven_start_time=strtotime($seven_start_time);

        dump($start_time);
        dump($end_time);
        dump($two_start_time);
        dump($two_end_time);
        dump( $three_start_time);
        dump( $three_end_time);
        dump( $four_start_time);
        dump( $four_end_time);
        dump( $five_start_time);
        dump( $five_end_time);
        dump( $six_start_time);
        dump( $six_end_time);
        dump( $seven_start_time);
        dump( $seven_end_time);

    }

    /**
     * 数据统计
     */


}